<template>
  <div>
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/welcome' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>权限管理</el-breadcrumb-item>
      <el-breadcrumb-item>权限列表</el-breadcrumb-item>
    </el-breadcrumb>
    <el-card class="box-card" style="margin-top: 15px">
      <el-table :data="tableData" border style="width: 100%">
        <el-table-column type="index" label="#" width="50"> </el-table-column>
        <el-table-column prop="authName" label="权限名称"> </el-table-column>
        <el-table-column prop="path" label="路径"> </el-table-column>
        <el-table-column label="权限等级">
          <template slot-scope="scope">
            <el-tag v-show="scope.row.level == 0">一级权限</el-tag>
            <el-tag v-show="scope.row.level == 1" type="success">二级权限</el-tag>
            <el-tag v-show="scope.row.level == 2" type="danger">三级权限</el-tag>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
import { getPermissionsAPI } from "@/http/api";
export default {
  data() {
    return {
      tableData: [],
    };
  },
  created() {
    this.getlist();
  },
  components: {},
  mounted() {},
  methods: {
    async getlist() {
      var res = await getPermissionsAPI();
      console.log(res);
      this.tableData = res;
    },
  },
  computed: {},
  watch: {},
};
</script>

<style scoped lang='sass'>
</style>
